Previous | Index |

Function adaptors

Function adaptors work only with function object classes with argument types and result type defined.

Negators

Negators Not1 api and Not2 api take a unary and a binary predicate correspondingly and return their complements.

Predicate Binders

Binders Bind1stPredicate api and Bind2ndPredicate api take a predicate object f of two arguments (Predicate2) and a value x and return a predicate object of one argument constructed out of f with the first or second argument correspondingly bound to x. For example,
    find(v.begin(), v.end(), new Bind2ndPredicate(new GreaterInt(), new Integer(5)))
finds the first integer in vector v greater than 5;
    find(v.begin(), v.end(), new Bind1stPredicate(new GreaterInt(), new Integer(5)))
finds the first integer in v less than 5.

Function Binders

Binders Bind1stFunction api and Bind2ndFunction api take a function object f of two arguments (Function2) and a value x and return a function object of one argument constructed out of f with the first or second argument correspondingly bound to x. For example,
    find(v.begin(), v.end(), new Bind2ndFunction(new GreaterInt(), new Integer(5)))
finds the first integer in vector v greater than 5;
    find(v.begin(), v.end(), new Bind1stFunction(new GreaterInt(), new Integer(5)))
finds the first integer in v less than 5.


Previous | Index |